//2009/08/19 18:01:33
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class IndicatorMotion
{
public:
    string getMotion(string program, char startState)
    {
		program = replc(program);
		string ret = "";
		ret += startState;
		for(int i=0; i<program.size(); i++)
		{
			startState = successor(startState, program[i]);
			ret += startState;
		}
		return ret;
    }
private:
    char successor(char c, char op)
    {
        switch (op)
        {
        case 'L':
            if (c == '|') return '\\';
            if (c == '\\') return '-';
            if (c == '-') return '/';
            if (c == '/') return '|';
        case 'R':
            if (c == '|') return '/';
            if (c == '\\') return '|';
            if (c == '-') return '\\';
            if (c == '/') return '-';
        case 'S':
            return c;
        case 'F':
            if (c == '|') return '-';
            if (c == '\\') return '/';
            if (c == '-') return '|';
            if (c == '/') return '\\';
        }
    }
    string replc(string s)
    {
        string ret = "";
		for(int i=0; i<s.size(); i+=3)
		{
			int num = (s[i+1]-'0')*10 + (s[i+2]-'0');
			string temp(num,s[i]);
			ret += temp;
		}
		return ret;
    }
};
